﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Financial_Month_Maintain.aspx.cs" MasterPageFile="~/MasterPage.master"
    Inherits="System_Financial_Month_Maintain" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title></title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<script type="text/javascript">
    /*  
    将Date/String类型,解析为String类型.  
    传入String类型,则先解析为Date类型  
    不正确的Date,返回 ''  
    如果时间部分为0,则忽略,只返回日期部分.  
    */
    function formatDate(v) {
        if (v instanceof Date) {
            var y = v.getFullYear();
            var m = v.getMonth() + 1;
            var d = v.getDate();
            var h = v.getHours();
            var i = v.getMinutes();
            var s = v.getSeconds();
            var ms = v.getMilliseconds();
            if (ms > 0)
                return y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s
						+ '.' + ms;
            if (h > 0 || i > 0 || s > 0)
                return y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s;
            return y + '-' + m + '-' + d;
        }
        return '';
    }

    $(function () {
        $('#<%=txtDate.ClientID %>').datebox({
            currentText: '今天',
            closeText: '关闭',
            disabled: false,
            required: true,
            missingMessage: '必填',
            formatter: formatDate
        });
    });
     
</script>
    <div>
        <table id="wsd_inputtable">
            <tr>
                <td class="tabletitle" colspan="3">
                    会计期管理
                </td>
            </tr>
            <tr>
                <td width="16%" class="tablefield">
                    &nbsp;日期:
                </td>
                <td width="84%">
                    <input id="txtDate" runat="server"    class="default"  type="text" />
                </td>
                <td class="buttonarea">
                    <asp:Button ID="btnSearch" runat="server" CssClass="wsd_button2" Text="查  询" OnClick="btnSearch_Click" />
                </td>
            </tr>
        </table>
        <br />
        <table id="wsd_inputtable">
            <tr>
                <td class="tabletitle">
                    会计期列表
                </td>
            </tr>
        </table>
        <table id="wsd_listtable" width="100%">
            <tr>
                <td style="width: 100%">
                    <asp:GridView Width="100%" ID="gvChannelType" runat="server" AutoGenerateColumns="False"
                        EmptyDataText="<%$ resources:language,lbl_Empty %>" EmptyDataRowStyle-Font-Bold="true"
                        EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="Grid_RowDataBound"
                        EnableEmptyContentRender="true" OnRowCommand="gvChannelType_RowCommand" AllowPaging="True"
                        OnPageIndexChanging="gvChannelType_PageIndexChanging" PageSize="20">
                        <Columns>
                            <asp:BoundField HeaderText="时间" DataField="Date" />
                            <asp:TemplateField HeaderText="状态">
                                <ItemTemplate>
                                    <b>
                                        <%# Eval("Status").ToString()=="1" ? "<font color='green'>打开</font>" : "<font color='red'>关闭</font>"%></b>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作">
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnSwitch" runat="server" Text='<%#  Eval("Status").ToString()=="1" ?"关闭":"打开" %>'
                                        CssClass="btn3_mouseover" CommandName="EditStatus" CommandArgument='<%# Eval("Date")%>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle CssClass="titlist" />
                        <EmptyDataRowStyle HorizontalAlign="Center" Font-Bold="True"></EmptyDataRowStyle>
                        <RowStyle CssClass="evenline" />
                        <AlternatingRowStyle CssClass="oddline" />
                        <PagerSettings FirstPageText="<%$ resources:language, lbl_First_Page%>" LastPageText="<%$ resources:language, lbl_Last_Page%>"
                            Mode="NumericFirstLast" PageButtonCount="30" />
                    </asp:GridView>
            </tr>
        </table>
        <br />
        <table id="wsd_inputtable">
            <tr>
                <td width="100%" class="tabletitle">
                    操作选项
                </td>
            </tr>
            <tr>
                <td class="buttonarea">
                    <asp:Button ID="btnSave" runat="server" class="wsd_button2" Text="新  增" OnClick="btnSave_Click" />
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
